package com.huazi.www.drug.drugz.util;

import java.util.List;

/**
 * @description：分页
 * @author：zt
 * @date：2021/5/11 0:04
 * @versions：v1.0
 */
public class Page<T> {

    private Integer totalCount;    //总记录数
    private Integer pageSize;      //每页显示的条数
    private Integer totalPage;     //总页数
    private Integer currentPage;   //页码
    private List<T> list;          //每页显示的数据

    public Integer getTotalCount() {
        return totalCount;
    }

    public void setTotalCount(Integer totalCount) {
        this.totalCount = totalCount;
        if (totalCount > 0) {
            totalPage = totalCount % pageSize == 0 ? totalCount / pageSize : totalCount / pageSize + 1;
        } else {
            totalPage = 0;
        }
    }

    public Integer getPageSize() {
        return pageSize;
    }

    public void setPageSize(Integer pageSize) {
        this.pageSize = pageSize;
    }

    public Integer getTotalPage() {
        return totalPage;
    }

    public void setTotalPage(Integer totalPage) {
        this.totalPage = totalPage;
    }

    public Integer getCurrentPage() {
        return currentPage;
    }

    public void setCurrentPage(Integer currentPage) {
        this.currentPage = currentPage;
    }

    public List<T> getList() {
        return list;
    }

    public void setList(List<T> list) {
        this.list = list;
    }

}
